<p class='msview'>
	<span>
		<?php echo $this->session->flashdata('msview'); ?>
	</span>
</p>

<div class="header2"><p class="pHead"><?php echo $title; ?></p></div>
            <div class="contentMain">
            <div class="contentSearch">
            <form method="POST" action="<?php echo base_url() ?>back_end/order/search">            	
	            <table class="tableSearch">
	                <tr>
	                    <td class="tdSearch">Tên khách hàng</td>
	                    <td class="tdSearch2">
	                    	<input type="text" name="nameSearch" class="inputText required" />
	                    </td>
	                </tr>            	
	                <tr>
	                    <td class="tdSearch">&nbsp;</td>
	                    <td class="tdSearch2">                        	
	                            <div class="searchbutton">
	                            	<input type="submit" class="buttonSM" value="Search" name="formSearch" />
	                            </div><!-- end searchbutton -->
	                        </td>
	                    </tr>   
	            </table>
            </form> 
            </div><!-- end contentSearch -->
                
                <form id="frmForm" method="POST" action="<?php echo base_url()?>back_end/order/delete">
	                <div class="headerSearch tblHead" style="border-bottom:none;">
		                <table class="tbl_head">
		                    <tr>
		                    	<td><span class="count_check"></span></td>
		                    </tr>
		                </table>
	                </div><!-- end headerSearch -->
	                
	                <table class="tablePr" width="100%">
	                	<tr class="trPr1">
		                    <td width="5%" class="tdPr7"><input type="checkbox" class="input_checkall" /></td>
		                    <td width="5%" class="tdPr7">
		                    	<a   title="Click để sắp xếp"  href="<?php echo base_url() ?>back_end/order/sort/id/<?php echo $sort; ?>">ID</a>
		                    </td>
                    		<td width="10%" class="tdPr7">
			                	<a title="Click để sắp xếp" href="<?php echo base_url() ?>back_end/order/sort/order_code/<?php echo $sort; ?>">
			                		Mã hóa đơn
			                	</a>
		                    </td>
		                    <td width="20%" class="tdPr7">
		                    	<a title="Click để sắp xếp" href="<?php echo base_url() ?>back_end/order/sort/name_user/<?php echo $sort; ?>">
                                	Tên khách hàng
			                	</a>
		                    </td>
		                    <td width="10%" class="tdPr7">
		                    	<a title="Click để sắp xếp" href="<?php echo base_url() ?>back_end/order/sort/payment/<?php echo $sort; ?>">
                                	Đã thanh toán
			                	</a>
		                    </td>
		                    <td width="20%" class="tdPr7">
		                    	<a title="Click để sắp xếp" href="<?php echo base_url() ?>back_end/order/sort/checkmail/<?php echo $sort; ?>">
                                	Đã gửi mail tới khách hàng
			                	</a>
		                    </td>
		                    <td width="10%" class="tdPr7">
		                    	<a title="Click để sắp xếp" href="<?php echo base_url() ?>back_end/order/sort/created_date/<?php echo $sort; ?>">
			                		Ngày tạo
			                	</a>
		                    </td>
		                     <td width="10%" class="tdPr7">
		                    	<a title="Click để sắp xếp" href="<?php echo base_url() ?>back_end/order/sort/last_date/<?php echo $sort; ?>">
			                		Ngày sửa
			                	</a>
		                    </td>
		                    <td width="10%" class="tdPr7">
		                    	<a>Tác vụ</a>
		                    </td>
		                </tr>
		                
		                <?php
		                	$count = 1; 
		                	foreach ($admin_order as $value) {
		                		$count += 1;	 
		                ?> 
			                <tr class="<?php if ($count%2) { echo 'trPr3'; } else { echo 'trPr2'; }  ?>">
			                    <td class="tdPr7">
			                    	<input class="input_checkbox" type="checkbox"  value="<?php echo $value['id']; ?>" name="value_id[]"/>
			                    </td>
			                    
			                    <td class="tdPr7">
			                    	<?php echo $value['id']; ?>
			                    </td>
			                         
			                    <td class="tdPr7">
			                    	<a class="news_underline" title="Click để xem đơn hàng" href="<?php echo base_url()?>back_end/order/view/<?php echo $value['id']; ?>"><?php echo $value['order_code']; ?></a>
			                    </td>
			                    
		                       <td class="tdPr7">
			                    	<?php echo $value['name_user']; ?>
			                    </td>
			                    
		                        <td class="tdPr7">
			                    	
			                    </td>
			                    
			                    <td class="tdPr7">
			                    	
			                    </td>
			                    
			                    <td class="tdPr7">	
			                    	<?php echo $value['created_date']; ?>
			                    </td>
			                    
			                    <td class="tdPr7">
			                    	<?php echo $value['last_date']; ?>
			                    </td>
			                    
			                    <td class="tdPr7">
			                    	<?php if($value['status'] == 1) { ?>
			                    		<a class="tag_action" href="<?php echo base_url()?>back_end/order/active/<?php echo $table.'-'.$value['id'].'-'.'0'.'-'.$table; ?>"><img src="<?php echo base_url()?>images/back_end/icon/check2.png" title="Trạng thái" alt="icon check" /></a>
			                    	<?php } else { ?>
			                 			<a class="tag_action" href="<?php echo base_url()?>back_end/order/active/<?php echo $table.'-'.$value['id'].'-'.'1'.'-'.$table; ?>"><img src="<?php echo base_url()?>images/back_end/icon/check.png" title="Trạng thái" alt="icon check" /></a>
			                    	<?php }?>
			                    	<a class="tag_action" href="<?php echo base_url()?>/back_end/order/edit/<?php echo $value['id']; ?>"><img src="<?php echo base_url()?>images/back_end/icon/edit-icon.gif" alt="Sửa" title="Sửa" /></a>
			                    	<a class="tag_action" href="<?php echo base_url()?>back_end/order/deleteId/<?php echo $value['id']; ?>"><img src="<?php echo base_url()?>images/back_end/icon/delete_png.png" title="Xóa"  alt="icon" /></a>
			                    </td>
		                    </tr>
	                    <?php } ?>
	                </table>
	                
	                <div class="headerSearch tblDel" style="border-top:none;">
	               		<table>
	                    	<tr>
                        		<td>&nbsp;</td>
	                        </tr>
	                    </table>
	                </div><!-- end headerSearch -->
                </form>
                
                <table class="tableLet2" style="margin:10px 10px 0 0;">
                    <tr>
                        <td width="60%" align="right" class="viewNumber" style="padding-right:10px;">
                        	<?php echo $this->pagination->create_links(); ?>
                        </td>
                    </tr>
                  </table>  
                  
            </div><!-- end contentMain -->